<js href="__PUBLIC__/kindeditor/kindeditor-min.js"/>
<js href="__PUBLIC__/kindeditor/lang/zh_CN.js"/>
<js href="__PUBLIC__/kindeditor/plugins/code/prettify.js"/>
<css href="__PUBLIC__/kindeditor/themes/default/default.css"/>
<css href="__PUBLIC__/kindeditor/plugins/code/prettify.css"/>

<script type="text/javascript">
    KindEditor.ready(function (K) {
        var editor1 = K.create('textarea[name="content"]', {
            cssPath:'__PUBLIC__/kindeditor/plugins/code/prettify.css',
            uploadJson:'__PUBLIC__/kindeditor/php/upload_json.php',
            fileManagerJson:'__PUBLIC__/kindeditor/php/file_manager_json.php',
            allowFileManager:true
        });
        prettyPrint();
    });
</script>
<div class="subnav">
    <if condition="$edititem">
        编辑内容
        <else/>
        新增内容
    </if>
</div>
<if condition="$edititem">
    <form action="__APP__/Content/post_edit" method="post" name="postcontent">
        <input type="hidden" name="id" value="{$edititem['id']}"/>
        <else/>
        <form action="__APP__/Content/post_add" method="post" name="postcontent">
</if>

<div class="contenteditor">
    <div style="width: 300px" class="com-right">
        <div class="dlheader com-right">附加信息</div>
        <dl>
            <dt>作者：</dt>
            <dd><input type="text" name="author_name" value="{$edititem['author_name']}"/></dd>
            <dt>来源：</dt>
            <dd><input type="text" name="from_path" value="{$edititem['from_path']}"/></dd>
            <dt>关键字：</dt>
            <dd><input type="text" name="keyword" value="{$edititem['keyword']}"/></dd>
        </dl>
    </div>
    <div style=" margin-right:310px;">
        <div style="overflow: hidden;">
            <ul>
                <li>频道:</li>
                <li>
                    <select name="channel_id">
                        <option value="-99">--请选择频道--</option>
                        <foreach name='channellist' item='item'>

                            <option value="{$item[id]}"
                            <eq name="item['type']" value="single">class="notCanSle"</eq>
                            >{$item['title']}</option>

                            <present name="item['child']">
                                <foreach name='item["child"]' item='childitem'>
                                    <option value="{$childitem[id]}"
                                    <eq name="childitem['type']" value="single">class="notCanSle"</eq>
                                    >{$childitem['title']}</option>
                                </foreach>
                            </present>
                        </foreach>
                    </select>
                </li>
                <li>标题:</li>
                <li><input type="text" value="{$edititem['title']}" style="width: 400px;" name="title"/></li>
            </ul>
        </div>
        <textarea name="content" style="visibility:hidden;height: 400px;width: 100%;">
            {$edititem['content']}
        </textarea>
    </div>

    <div class="formbtn">
        <p align="center" style="padding: 15px"><input type="submit" value="保存"/><input type="reset" value="重置"/></p>
    </div>
</div>

</form>
